Python Program to Form a Dictionary from an Object of a Class